{{- $type := .Page.Scratch.Get "type" }}
{{- if eq $type "link" }}
<a href="{{- .Permalink }}" class="collection-item" itemprop="url"  target="_blank" >
    <time datetime="{{ .Date }}"
        itemprop="datePublished">{{- .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}</time>
    <span>&nbsp;&nbsp;&nbsp;</span> {{- .Title }}
</a>
{{-  else if eq $type "card" }}
<article class="panel panel-default hover-shadow hover-grow" itemscope itemtype="http://schema.org/BlogPosting">
    <div class="panel-body">
        <div class="article-meta">
            <time datetime="{{ .Date }}"
                itemprop="datePublished">{{- .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}</time>
        </div>
        <h3 class="article-title" itemprop="name">
            <a class="article-link" href="{{- .Permalink }}">{{- .Title }}</a>
        </h3>
    </div>
    {{- with .Params.tags }}
    <div class="panel-footer">
        {{- range first 3 .  }}
        <a href="{{ "tags/" | absURL }}{{ . | urlize }}" class="label label-default mb">{{ . }}</a>
        {{- end }}
        {{- if gt (len .) 3 }}
        <span class="label label-default mb">···</span>
        {{- end }}
    </div>
    {{- end }}
</article>
{{- else  }}
<a href="{{- .RelPermalink }}" class="collection-item" target="_blank" itemprop="url">
    <time datetime="{{ .Date }}"
        itemprop="datePublished">{{- .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}</time>
    <span>&nbsp;&nbsp;&nbsp;</span> {{- .Title }}
</a>
{{- end }}